function GetTime() {
var dt = new Date();
var def = dt.getTimezoneOffset() / 60;
var gmt = (dt.getHours() + def);


var ending = ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds());


var ho = check24(((gmt + 8) > 24) ? ((gmt + 8) - 24) : (gmt + 8));
document.getElementById("hongkong").innerText = (IfZero(ho) + ending);


var lundun = check24(((gmt) > 24) ? ((gmt) - 24) : (gmt));
document.getElementById("london").innerText = (IfZero(lundun) + ":" + IfZero(dt.getMinutes()) + ":" + IfZero(dt.getSeconds()));


var niuyue = check24(((gmt + (24 - 5)) > 24) ? ((gmt + (24 - 5)) - 24) : (gmt + (24 - 5)));
document.getElementById("newyork").innerText = (IfZero(niuyue) + ending);



setTimeout("GetTime()", 1000);
}
function IfZero(num) {
return ((num <= 9) ? ("0" + num) : num);
}
function check24(hour) {
return (hour >= 24) ? hour - 24 : hour;
}

